const express = require('express');
const app = express();
app.use(express.static('public'));

// 注册路由(get类型)
app.get('/index', (req, res) => {
    // send 自带响应头
    res.send('get路由');
})
// 注册路由(post类型)
app.post('/index', (req, res) => {
    res.send('post路由');
})

app.listen('8989', () => {
    console.log('服务已启动','http://localhost:8989');
})